﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MemberSearchForm.aspx.cs" EnableEventValidation="false" 
    Inherits="App_Common_MemberSearchForm" %>

<%@ Register Assembly="ShpmCommon" Namespace="Shpm.System.Web.Control" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>会员检索画面</title>
    <link href="../../style/style.css" rel="stylesheet" type="text/css" />

    <script language="javascript" type="text/javascript" src="../../javascript/commons.aspx"></script>

</head>

<script>
function selectEmployee(id,name)
    {

     var obj = opener.window.document.getElementById('<%=Request.QueryString["CONTROL_ID"]%>');
     var obj2 = opener.window.document.getElementById('<%=Request.QueryString["CONTROL_NAME"]%>');

     if(obj!=null && obj2!=null)
     {
        obj.value=id;
        obj2.value=name;

        window.close();
     }
    }
    
    function buildChange(object)
    {
     CommonAjaxUtils.FindFloor(object.value,get_floor_Result_CallBack);
     CommonAjaxUtils.FindRoom(object.value,"",get_room_Result_CallBack);

    }
    
    function floorChange(object)
    {
         var objBuildNo= window.document.getElementById('<%=dropBuildNo.ClientID %>')
         CommonAjaxUtils.FindRoom(objBuildNo.value,object.value,get_room_Result_CallBack);
    }
    function get_floor_Result_CallBack(response)
            {
                if (response.value != null)
                {                    
 
                    var drop = window.document.getElementById('<%=dropFloor.ClientID %>');
                    drop.length=0;　　　　            
　　　　            var ds = response.value;
                    if(ds != null && typeof(ds) == "object")
                    {                   
　　　　　　                drop.options.add(new Option("",""));
                        for(var i=0; i<ds.length; i++)
　　　　                {
　　　　       
　　　　　　                var name=ds[i].Floor;
　　　　　　                var id=ds[i].Floor;
　　　　　　                drop.options.add(new Option(name,id));
　　　　                }                
                    }
                }
                return
            }
            
            function get_room_Result_CallBack(response)
            {
                if (response.value != null)
                {                    
 
                    var drop = window.document.getElementById('<%=dropRoom.ClientID %>');
                    drop.length=0;　　　　            
　　　　            var ds = response.value;
                    if(ds != null && typeof(ds) == "object")
                    {                   
　　　　　　                drop.options.add(new Option("",""));
                        for(var i=0; i<ds.length; i++)
　　　　                {
　　　　       
　　　　　　                var name=ds[i].ApartmentNo;
　　　　　　                var id=ds[i].ApartmentNo;
　　　　　　                drop.options.add(new Option(name,id));
　　　　                }                
                    }
                }
                return
            }

</script>

<body style="background-image: url('../../images/bgbg2.jpg')">
    <form id="form1" runat="server">
        <div>
            <table class="table_border_bg">
                <tr>
                    <td colspan="6" align="center">
                        <b>会员检索画面<br />
                            &nbsp;</b></td>
                </tr>
            </table>
            <table width="100%">
                <tr>
                    <td style="height: 30px">
                        <table class="table_border_line">
                            <tr>
                                <td align="left" colspan="4">

                                    <script language="javascript">
                        (new TitleBar('SearchBar', '检索结果')).showBar();
                                    </script>

                                </td>
                            </tr>
                        </table>
                        
                    </td>
                </tr>
                <tr>
                    <td align="center" >
                    <table class="table_border_line" style="background-color: #ffffff">
                            <tr>
                                <td style="width: 184px" >
                                    &nbsp;</td>
                                <td  align="left">
                                    会员编号</td>
                                <td align="left" >
                                    &nbsp;<asp:TextBox ID="txtMemberNo" runat="server" Width="86px" MaxLength="12"></asp:TextBox></td>
                                <td align="left" >
                                    楼号</td>
                                <td align="left" >
                                    <asp:DropDownList ID="dropBuildNo" runat="server" DataTextField="BuildingNo"
                                        DataValueField="BuildingNo" CausesValidation="True" Width="76px" onchange="buildChange(this)">
                                    </asp:DropDownList>&nbsp;</td>
                            </tr>
                            <tr>
                                <td style="width: 184px; height: 25px;">
                                    &nbsp;</td>
                                <td style="width: 120px; white-space: nowrap; height: 25px;" align="left">
                                    会员姓名</td>
                                <td align="left" style="height: 25px; width: 246px;">
                                    &nbsp;<asp:TextBox ID="txtName" runat="server" MaxLength="100" Width="86px"></asp:TextBox></td>
                                <td align="left" style="width: 124px; height: 25px">
                                    楼层</td>
                                <td align="left" style="height: 25px">
                                    <asp:DropDownList ID="dropFloor" runat="server" DataTextField="Floor" DataValueField="Floor"
                                        Width="76px" onchange="floorChange(this)">
                                    </asp:DropDownList>&nbsp;</td>
                            </tr>
                            <tr>
                                <td style="width: 184px; height: 26px">
                                </td>
                                <td align="left" style="width: 120px; white-space: nowrap; height: 26px">
                                    会员类型</td>
                                <td align="left" style="height: 26px; width: 246px;">
                                    &nbsp;<asp:DropDownList ID="dropMemberType" runat="server" DataTextField="Content"
                                        DataValueField="DictNo" Width="90px">
                                    </asp:DropDownList></td>
                                <td align="left" style="width: 124px; height: 26px">
                                    房间号</td>
                                <td align="left" style="height: 26px">
                                <asp:DropDownList ID="dropRoom" runat="server" DataTextField="ApartmentNo" DataValueField="ApartmentNo"
                                        Width="76px">
                                    </asp:DropDownList></td>
                            </tr>
                            <tr>
                                <td style="width: 184px; height: 70px">
                                </td>
                                <td align="left" style="width: 120px; white-space: nowrap; height: 70px">
                                </td>
                                <td align="center" style="width: 246px; height: 70px">
                                    <asp:Button ID="btnSeach" runat="server" CssClass="button1" Text="检 索" Width="87px"
                                        OnClick="btnSeach_Click" /></td>
                                <td align="left" style="width: 124px; height: 70px">
                                </td>
                                <td align="left" style="height: 70px">
                                </td>
                            </tr>
                            
                        </table>
                    </td>
                </tr>

                     
 

            </table>
            <br />
            <table width="100%">
            </table>
            <table class="table_border_bg">
                <tr>
                    <td>
                        <asp:GridView ID="GridView1" runat="server"  AutoGenerateColumns="False" OnPageIndexChanging="GridView1_PageIndexChanging"
                            OnRowDataBound="GridView1_RowDataBound" Width="100%" AllowPaging="True" CssClass="GridView_table"
                            BorderStyle="Solid">
                            <Columns>
                                <asp:TemplateField HeaderText="选择" ShowHeader="False">
                                    <ItemStyle CssClass="GridView_item_center" HorizontalAlign="Center" VerticalAlign="Middle" />
                                    <HeaderStyle CssClass="GridView_head_grayblue" />
                                    <ItemTemplate>
                                        <asp:ImageButton ID="selectImg" runat="server" CausesValidation="False" CommandName="Select"
                                            ImageUrl="~/images/info.gif" Text="" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField HeaderText="会员编号" DataField="MemberNo">
                                    <ItemStyle CssClass="GridView_item_center" />
                                    <HeaderStyle CssClass="GridView_head_grayblue" />
                                </asp:BoundField>
                                <asp:BoundField DataField="NameC" HeaderText="会员姓名">
                                    <ItemStyle CssClass="GridView_item_center" />
                                    <HeaderStyle CssClass="GridView_head_grayblue" />
                                </asp:BoundField>
                                <asp:BoundField DataField="SexText" HeaderText="性别">
                                    <ItemStyle CssClass="GridView_item_center" />
                                    <HeaderStyle CssClass="GridView_head_grayblue" />
                                </asp:BoundField>
                                <asp:BoundField DataField="Abode" HeaderText="住所">
                                    <ItemStyle CssClass="GridView_item_center" />
                                    <HeaderStyle CssClass="GridView_head_grayblue" />
                                </asp:BoundField>
                                <asp:BoundField DataField="MemberTypeText" HeaderText="会员类型">
                                    <ItemStyle CssClass="GridView_item_center" />
                                    <HeaderStyle CssClass="GridView_head_grayblue" />
                                </asp:BoundField>
                            </Columns>
                            <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                        </asp:GridView>
                    </td>
                </tr>
            </table>
        </div>
        
    </form>
</body>
</html>
